package com.biscuit.page.basicservice.convert;

import com.biscuit.page.basicservice.api.model.vo.UserDetailVO;
import com.biscuit.page.basicservice.utils.JsonUtil;
import org.mapstruct.Named;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @author mazihao
 * @createTime 2024/4/7 13:14
 */
@Component
@Named("UserDetailCustom")
public class UserDetailCustom {

    @Named("backgroundImageJson2List")
    List<UserDetailVO.BackgroundImageItem> backgroundImageJson2List(String json) {
        try {
            return JsonUtil.parseList(json, UserDetailVO.BackgroundImageItem.class);
        } catch (Exception e) {
            return new ArrayList<>();
        }
    }

}
